package com.zj.tools;

import com.fasterxml.jackson.databind.ObjectMapper;
import com.zj.pojo.Apple;
import org.mapstruct.Mapper;
import org.mapstruct.Mapping;
import org.mapstruct.factory.Mappers;

import java.util.List;
import java.util.Map;

@Mapper
public interface MyObjectMapper {
    MyObjectMapper INSTANCE = Mappers.getMapper(MyObjectMapper.class); // 单例模式获取实例
    ObjectMapper myMapper = new ObjectMapper();
//
//    @Mapping(target = "id", source = "id")
//    @Mapping(target = "region", source = "region")
//    @Mapping(target = "weight", source = "weight")
//
//    Apple toApple(Map<String, Object> map); // 自动生成的方法来处理映射逻辑。需要确保字段名称匹配。
//
//    List<Apple> toAppleList(List<Map<String, Object>> list); // 自动生成的方法来处理映射逻辑。需要确保字段名称匹配。

}
